var e = require("../@babel/runtime/helpers/interopRequireDefault").default;

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.default = void 0;

var t = e(require("@vant/weapp/dialog/dialog.js")), a = e(require("../api/api_shareCard")), i = e(require("../api/auth.js")), n = e(require("../utils/Tips")), r = getApp(), u = Behavior({
    behaviors: [],
    properties: {
        sid: {
            type: String
        },
        a: {
            type: String
        }
    },
    data: {
        myBehaviorData: {}
    },
    attached: function() {},
    methods: {
        getMiniAuth: function(e) {
            return new Promise(function(t, i) {
                a.default.getQQ(e).then(function(a) {
                    var i = a.code, r = a.result;
                    a.msg;
                    t(), "0" === i && r && (e && n.default.toast("您已绑定成功，请点击立即邀请按钮来分享活动哦~"), t());
                }).catch(function(e) {
                    i();
                });
            });
        },
        getOpenID: function() {
            return r.globalData.aucMiniAuth.sid = "", new Promise(function(e, t) {
                a.default.getOpenID().then(function(t) {
                    var a = t.code, i = t.result;
                    t.msg;
                    "0" === a && i && e();
                }).catch(function(e) {
                    t();
                });
            });
        },
        bindgetphonenumber_auc: function(e) {
            var a = this;
            e.detail.iv && e.detail.encryptedData && (n.default.loading(), i.default.auth({
                source: 2,
                encryptedData: e.detail.encryptedData,
                iv: e.detail.iv
            }).then(function(t) {
                debugger;
                n.default.loaded(), a.afterBindgetphonenumber && a.afterBindgetphonenumber(t, e);
            }).catch(function(e) {
                n.default.loaded(), t.default.alert({
                    context: a,
                    message: "切换手机号码失败，请重试"
                });
            }));
        }
    }
});

exports.default = u;